package com.joolun.system.service.impl;

import java.util.List;
import com.joolun.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.stereotype.Service;
import com.joolun.system.mapper.EduAgreementMapper;
import com.joolun.system.domain.EduAgreement;
import com.joolun.system.service.IEduAgreementService;

/**
 * 协议信息Service业务层处理
 * 
 * @author joolun
 * @date 2025-02-27
 */
@Service
public class EduAgreementServiceImpl extends  ServiceImpl<EduAgreementMapper, EduAgreement> implements IEduAgreementService
{
    @Autowired
    private EduAgreementMapper eduAgreementMapper;

    /**
     * 查询协议信息
     * 
     * @param agreementId 协议信息主键
     * @return 协议信息
     */
    @Override
    public EduAgreement selectEduAgreementByAgreementId(Long agreementId)
    {
        return eduAgreementMapper.selectEduAgreementByAgreementId(agreementId);
    }

    /**
     * 查询协议信息列表
     * 
     * @param eduAgreement 协议信息
     * @return 协议信息
     */
    @Override
    public List<EduAgreement> selectEduAgreementList(EduAgreement eduAgreement)
    {
        return eduAgreementMapper.selectEduAgreementList(eduAgreement);
    }

    /**
     * 新增协议信息
     * 
     * @param eduAgreement 协议信息
     * @return 结果
     */
    @Override
    public int insertEduAgreement(EduAgreement eduAgreement)
    {
        eduAgreement.setCreateTime(DateUtils.getNowDate());
        return eduAgreementMapper.insertEduAgreement(eduAgreement);
    }

    /**
     * 修改协议信息
     * 
     * @param eduAgreement 协议信息
     * @return 结果
     */
    @Override
    public int updateEduAgreement(EduAgreement eduAgreement)
    {
        eduAgreement.setUpdateTime(DateUtils.getNowDate());
        return eduAgreementMapper.updateEduAgreement(eduAgreement);
    }

    /**
     * 批量删除协议信息
     * 
     * @param agreementIds 需要删除的协议信息主键
     * @return 结果
     */
    @Override
    public int deleteEduAgreementByAgreementIds(Long[] agreementIds)
    {
        return eduAgreementMapper.deleteEduAgreementByAgreementIds(agreementIds);
    }

    /**
     * 删除协议信息信息
     * 
     * @param agreementId 协议信息主键
     * @return 结果
     */
    @Override
    public int deleteEduAgreementByAgreementId(Long agreementId)
    {
        return eduAgreementMapper.deleteEduAgreementByAgreementId(agreementId);
    }
}
